package com.ashen.study.model.request;

/**
 * @author Admin
 * @Classname UserRequest
 * @Description
 * @Date 2019/9/4 10:50
 * @Created by hxl
 */
//@NeedSecured
public class UserRequest {

    private Long id;

    private String name;

    private Integer sex;

    private Integer age;

    private String address;


    private static UserRequest instance = new UserRequest();

    public UserRequest() {
    }


    /**
     * 新增
     *
     * @param request
     * @return
     * @date 2019/11/20 11:22
     * @author hxl
     **/
    public static UserRequest addOf(UserRequest request) {
        instance.setName(request.name);
        instance.setSex(request.sex);
        instance.setAge(request.age);
        instance.setAddress(request.address);
        return instance;
    }


    /**
     * 更新
     *
     * @param request
     * @return
     * @date 2019/11/20 11:22
     * @author hxl
     **/
    public static UserRequest updateOf(UserRequest request) {
        instance.setId(request.id);
        instance.setName(request.name);
        instance.setSex(request.sex);
        instance.setAge(request.age);
        instance.setAddress(request.address);
        return instance;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "UserRequest{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sex=" + sex +
                ", age=" + age +
                ", address='" + address + '\'' +
                '}';
    }
}
